function padNumber(n) {
  return n > 9 ? n.toString() : '0' + n
}

export function formatDate(ts) {
  const d = new Date(ts)
  const month = d.getMonth() + 1
  const date = d.getDate()
  return `${d.getFullYear()}-${padNumber(month)}-${padNumber(date)} ${padNumber(d.getHours())}:${padNumber(d.getMinutes())}:${d.getSeconds()}`
}
